package cn.hxlc.tie.demo.core.enums;/*
 @author rui
 @date 2021/7/8 --19:06
*/

import cn.hxlc.tie.libs.scanner.stereotype.EnumResource;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;

@EnumResource
public enum LevelEnum implements IEnum<Integer> {
    ADVANCE(0,"领先水平"),
    FIRST(1,"先进水平"),
    SECOND(2,"一般水平"),
    BACKWARD(3,"落后水平"),
    ;

    @EnumValue
    private final int code;
    private final String descp;

    LevelEnum(int code, String descp) {
        this.code = code;
        this.descp = descp;
    }
   public String toString(){
        return this.descp;
   }

    @Override
    public Integer getValue() {
        return this.code;

    }
    public static StatusEnum toEnum(Integer code){
        if(null!=code){
            for (StatusEnum e: StatusEnum.values()) {
                if (e.getCode()==code){
                    return e;
                }
            }
        }
        return null;
    }
    public int getCode(){
        return code;
    }

}
